home *** CD-ROM | disk | FTP | other *** search
/ Publication 9 / Publication_09_1996_High-Tech_de_Side_B.d64 / windows on c64 (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  3KB  |  116 lines

  1. 10 rem*****************************
  2. 20 rem*                           *
  3. 30 rem*   windows demonstration   *
  4. 40 rem*                           *
  5. 50 rem*   eric randall     1988   *
  6. 60 rem*                           *
  7. 70 rem*****************************
  8. 80 rem
  9. 90 rem    initialisation
  10. 100 rem
  11. 105 poke53280,14:poke646,14:poke53281,6:print"[147]        loading: machine code[154]"
  12. 110 ifpeek(49152)<>72thenload"windows mc",8,1
  13. 120 poke52,100:poke56,100
  14. 130 init=50176:set=50179:pull=50182:back=50185:down=50188:up=50191:left=50194
  15. 140 right=50197
  16. 150 poke53265,peek(53265)and239
  17. 160 sysinit:sysset,1,3,5,19,30:sysset,2,2,2,14,30:sysset,4,5,8,8,23
  18. 170 syspull,1
  19. 180 print"[147]      instructions[146]":print"initialise system - sys50176
  20. 190 [153]"define window - sys50179,a,b,c,d,e  where:":[153]" a=window number (1 to 4)
  21. 200 print" b=start line  c=start row":print" d=number of lines
  22. 210 [153]" e=number of rows":[153]"pull down window - sys50182,a where a=window number
  23. 220 print"push back current window -    sys50185"
  24. 230 print"press a key":sysback
  25. 240 syspull,4:print"[147]to drag windows :-
  26. 250 [153]" down  - sys50188 f3wait":[153]" up    - sys50191 f4wait"
  27. 260 [153]" left  - sys50194 f6wait":[153]" right - sys50197 f5wait"
  28. 270 [158]back:[151]53265,[194](53265)[170]16
  29. 280 [143]
  30. 290 [143]    main menu
  31. 300 [143]
  32. 310 [153]"load          windows demonstration         wait"
  33. 320 [153]"  1wait  -  instructions
  34. 330 print"  2[146]  -  disk directory listing
  35. 340 [153]"  3wait  -  define your own window
  36. 350 print"  4[146]  -  pull down a window
  37. 360 [153]"  5wait  -  exit
  38. 370 print"after each exercise, press f1 to exit   from a window
  39. 380 [153]"      select optionwait
  40. 390 geta$:ifa$<"1"ora$>"5"then390
  41. 400 onval(a$)goto410,490,560,660,480
  42. 410 rem
  43. 420 rem    pull instruction window
  44. 430 rem
  45. 440 syspull,1:gosub740
  46. 450 syspull,4:gosub740
  47. 460 sysback:sysback
  48. 470 goto390
  49. 480 end
  50. 490 rem
  51. 500 rem    display directory
  52. 510 rem
  53. 520 syspull,2
  54. 530 print"[147]    disk listing[146]":print"insert disk and press a key"
  55. 540 geta$:ifa$=""then540
  56. 550 gosub850:gosub740:sysback:goto390
  57. 560 rem
  58. 570 rem    define a window
  59. 580 rem
  60. 590 syspull,1:print"[147]    define window[146]":print"your window will be number 3
  61. 600 a[178]3:[153]" start line";:[133]b:[153]"start row";:[133]c
  62. 610 [153]"number of lines";:[133]d:[153]"number of rows";:[133]e
  63. 620 [158]set,a,b,c,d,e:[158]pull,a
  64. 630 [153]"loadthis is your window.  use the curser and home controls to set up";
  65. 640 [153]"the display in this window then press return
  66. 650 inputa$:sysback:sysback:goto390
  67. 660 rem
  68. 670 rem    pull down a window
  69. 680 rem
  70. 690 syspull,2:print"[147]   pull down a window[146]
  71. 700 [153]"which window (1, 3 or 4)":[133]a
  72. 705 [139]a[179]1[176]a[177]4[176]a[178]2[167]700
  73. 710 [158]pull,a
  74. 720 [141]740
  75. 730 [158]back:[158]back:[137]390
  76. 740 [143]
  77. 750 [143]   check which key pressed
  78. 760 [143]   and move window
  79. 770 [143]
  80. 780 [161]a$:[139]a$[178]""[167]780
  81. 790 a[178][198](a$)
  82. 800 [139]a[178]138[167][158]up:[137]740
  83. 810 [139]a[178]134[167][158]down:[137]740
  84. 820 [139]a[178]139[167][158]left:[137]740
  85. 830 [139]a[178]135[167][158]right:[137]740
  86. 840 [142]
  87. 850 [143]
  88. 860 [143]    print disk directory
  89. 870 [143]
  90. 880 [159]2,8,15:z[178]0:p[178]1:[152]2,"i
  91. 890 open1,8,0,"$0"
  92. 900 get#1,a$,b$
  93. 910 get#1,a$,b$
  94. 920 get#1,a$,b$
  95. 930 c=0
  96. 940 if a$<>"" then c=asc(a$)
  97. 950 if b$<>"" then c=c+asc(b$)*256
  98. 960 d=3-len(str$(c)):d=e
  99. 970 print""mid$(str$(c),2);tab(3+e);"[146]";
  100. 980 forj=0tod:print" ";:next
  101. 990 get#1,b$:if st<>0 then 1090
  102. 1000 if b$<>chr$(34) then 990
  103. 1010 get#1,b$:if b$<>chr$(34)then printb$;:goto1010
  104. 1020 get#1,b$:if b$=chr$(32) then 1020
  105. 1030 print tab(21+e);:c$=""
  106. 1040 c$=c$+b$:get#1,b$:if b$<>""  then 1040
  107. 1050 print""left$(c$,3)
  108. 1060 ifz=0thenprint:z=z+1
  109. 1070 p=p+1:ifp=10then1110
  110. 1080 if st=0 then 910
  111. 1090 print" blocks free"
  112. 1100 close1:close2:return
  113. 1110 print"press a key[146]"
  114. 1120 geta$:ifa$=""then1120
  115. 1130 p=0:goto1080
  116.